/*
	@file: log/include/formatter/Formatter.h
	@author: Wolfhead
 */
#ifndef _LOG_FORMATTER_H_
#define _LOG_FORMATTER_H_

#include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp>
#include "../LogPriority.h"
#include "../LogData.h"

namespace logger
{

class Formatter;
typedef boost::shared_ptr<Formatter> FormatterPtr;

class Formatter
	: public boost::enable_shared_from_this<Formatter>
{
public:

	Formatter();

	virtual ~Formatter();

	FormatterPtr set_next(FormatterPtr formatter_ptr);

	void format(
		LogDataPtr data_ptr,
		std::string & output);

private:

	virtual void do_format(
		LogDataPtr data_ptr,
		std::string & output) = 0;

	FormatterPtr m_next_formatter_ptr;
};


} //namespace logger

#endif // #ifndef _LOG_FORMATTER_H_
